<template>
  <div>
    <FormPanel ref="from" :list="formList" @formChange="changeHandle" :isSubmitBtn="false" :collapse="false" labelWidth="110" />
    <div style="height:47px;"></div>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }"
    >
      <el-button @click="closeDrawer()">关 闭</el-button>
    </div>
  </div>
</template>
<script>
import { dictionary } from '@/utils/dictMixin';
import moment from 'moment';
export default {
  data() {
    this.saveData = null;
    this.Amount = null;
    this.singleRebateTotalAmount = null;
    this.buildRebateTotalAmount = null;
    return {
      formList: this.createdFrom(),
      isaddCar: false,
      carData: {},
      json: {},
      isDiscount: false,
      DiscountData: {},
      TotalAmount: '',
      singleRebateAmount: '',
      buildRebateAmount: '',
      tableLists: []
    };
  },
  props: ['rowData'],
  mounted() {
    this.$refs.from.form = this.rowData;
  },
  mixins: [dictionary],
  methods: {
    createdFrom() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '订单信息'
        },

        {
          type: 'INPUT',
          label: '订货单编号',
          fieldName: 'orderId',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '结算订单编号',
          fieldName: 'doNo',
          disabled: true
        },
        {
          type: 'DATE',
          label: '订单年月',
          fieldName: 'orderYearMonth',
          disabled: true,
          dateType: 'month',
          initialValue: moment().format('YYYY-MM')
        },
        {
          type: 'SELECT',
          label: '订单类型',
          fieldName: 'orderType',
          disabled: true,
          itemList: this.createDictList('6002')
        },
        {
          type: 'SELECT',
          label: '订单细分类型',
          fieldName: 'orderDetailType',
          disabled: true,
          itemList: []
        },
         {
          type: 'SELECT',
          label: '订单明细状态',
          fieldName: 'orderDetailStatus',
          disabled: true,
          itemList: []
        },
         {
          type: 'SELECT',
          label: '订单紧急度',
          fieldName: 'emergencyType',
          disabled: true,
          itemList: []
        },
        {
            type: 'SELECT',
            label: '车辆用途',
            fieldName: 'vehicleUse',
            placeholder: '所属分类',
            itemList: this.createDictList('1511'),
            disabled: true // 禁用
          },
        {
          type: 'INPUT',
          label: '订单经销商',
          fieldName: 'dealerName',
          disabled: true
        },
{
          type: 'SELECT',
          label: '运输方式',
          fieldName: 'transportType',
          disabled: true,
          itemList: this.createDictList('6004')
        },
        {
          type: 'INPUT',
          label: '收车地址',
          fieldName: 'address',
           disabled: true,
          
        },
        {
          type: 'SELECT',
          label: '送达城市',
          fieldName: 'powerCompany',
          // disabled: true,
          placeholder: '请选择',
          itemList: [],
          disabled: true
        },
        {
          type: 'INPUT',
          label: '联系人',
          fieldName: 'linkMan',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '联系电话',
          fieldName: 'linkPhone',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: 'VIN码',
          fieldName: 'vin',
          disabled: true
        },
       {
          type: 'INPUT',
          label: '物料编码',
          fieldName: 'materialCode',
          placeholder: '请选择',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '物料描述',
          fieldName: 'materialDescription',
          placeholder: '请选择',
          disabled: true,
        },
         {
          type: 'SELECT',
          label: '配置',
          fieldName: 'packageName',
          placeholder: '请选择',
          itemList: [],
          change: (val) => {
            this.changePackageSelect(val);
          },
          disabled: true
        },
        {
          type: 'SELECT',
          label: '选装',
          fieldName: 'optionName',
          placeholder: '请选择',
          itemList: [],
          disabled: true
        },
        {
          type: 'INPUT',
          label: '内饰',
          fieldName: 'trimName',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '外饰',
          fieldName: 'colorName',
          
          disabled: true
        },
        
        {
          type: 'INPUT',
          label: '资金类型',
          fieldName: 'accountTypeName',
          
          disabled: true
        },
        {
          type: 'INPUT',
          label: '市场指导价',
          fieldName: 'singleAmount',
          disabled:true,
        },
          {
          type: 'INPUT',
          label: '采购价格',
          fieldName: 'purchaseMoney',
          initialValue: '',
          placeholder: '',
           disabled: true,
        },
         {
          type: 'INPUT',
          label: '现金折让',
          fieldName: 'discountAmount',
          initialValue: '',
          placeholder: '',
           disabled: true,
        },
        {
          type: 'INPUT',
          label: '建店返利',
          fieldName: 'buildRebateAmount',
          initialValue: '',
          placeholder: '',
           disabled: true,
        },
{
          type: 'INPUT',
          label: '是否使用返利',
          fieldName: 'rebateAmount',
           disabled: true,
        },
        {
          type: 'INPUT',
          label: '返利池返利',
          fieldName: 'singleRebateAmount',
           disabled: true,
        },
      ];
    },
    changeHandle(val) {
      this.saveData = val;
    },
    async closeDrawer(type) {
      this.$emit('close');
    },
    Discountclose() {
      this.isDiscount = false;
    }
  }
};
</script>
<style lang="less">
.discount {
  text-decoration: underline;
  color: #d1291a;
  cursor: pointer;
}
</style>
